﻿namespace Basmus.Values
{
    public class PropertyInfoGetterSetterBuilder : IGetterSetterBuilder
    {
        private readonly IPropertyInfoBuilder _propertyInfoBuilder;

        public PropertyInfoGetterSetterBuilder(IPropertyInfoBuilder propertyInfoBuilder)
        {
            _propertyInfoBuilder = propertyInfoBuilder;
        }

        public IGetterSetter Build(ValuesContext valuesContext)
        {
            var propertyInfo = _propertyInfoBuilder.Build(valuesContext);
            var propertyInfoGeterSetter = new PropertyInfoGetterSetter(propertyInfo);
            return propertyInfoGeterSetter;
        }
    }
}